import Vue from 'vue'
// 1、导入vue-router包
import VueRouter from 'vue-router'
///2、手动安装
Vue.use(VueRouter)
// 4、导入相关组件
import home from './components/tabbar/home.vue'
import member from './components/tabbar/member.vue'
import cart from './components/tabbar/cart.vue'
import search from './components/tabbar/search.vue'
import newslist from './components/news/newslist.vue'
import newsInfo from './components/news/newsInfo.vue'
import photolist from './components/photos/photolist.vue'
import photoinfo from './components/photos/photoinfo.vue'
import goodlist from './components/goods/goodlist.vue'
import goodsinfo from './components/goods/goodsinfo.vue'
import goodetail from './components/goods/goodetail.vue'
import goodcomment from './components/goods/goodcomment.vue'




// 3、创建路由对象
var router=new VueRouter({
    routes:[
        {path:'/',redirect:'/home'},
        {path:'/home',component:home},
        {path:'/member',component:member},
        {path:'/cart',component:cart},
        {path:'/search',component:search} ,
        {path:'/home/newslist',component:newslist} ,
        {path:'/home/newsInfo/:id',component:newsInfo} ,
        {path:'/home/photolist',component:photolist},
        {path:'/home/photoinfo/:id',component:photoinfo},
        {path:'/home/goodlist',component:goodlist},
        {path:'/home/goodsinfo/:id',component:goodsinfo},
        {path:'/home/goodetail/:id',component:goodetail,name:'goodetail'},
        {path:'/home/goodcomment/:id',component:goodcomment,name:'goodcomment'}
    ],
    linkActiveClass:'mui-active'//覆盖默认路由高亮的类，本来叫做router-link-active
})
export default router
